Low latency query engine for apache hadoop

ABSTRACT

A low latency query engine for APACHE HADOOP™ that provides real-time or near real-time, ad hoc query capability, while completing batch-processing of MapReduce. In one embodiment, the low latency query engine comprises a daemon that is installed on data nodes in a HADOOP™ cluster for handling query requests and all internal requests related to query execution. In a further embodiment, the low latency query engine comprises a daemon for providing name service and metadata distribution. The low latency query engine receives a query request via client, turns the request into collections of plan fragments and coordinates parallel and optimized execution of the plan fragments on remote daemons to generate results at a much faster speed than existing batch-oriented processing frameworks.

CROSS REFERENCE TO RELATED APPLICATIONS

This application is a continuation of U.S. patent application Ser. No. 13/800,280, filed Mar. 13, 2013, entitled “LOW LATENCY QUERY ENGINE FOR APACHE HADOOP,” which is hereby incorporated by reference in its entirety.

BACKGROUND

APACHE HADOOP™ project (hereinafter “HADOOP™”) is an open-source software framework for developing software for reliable, scalable and distributed processing of large data sets across clusters of commodity machines. HADOOP™ includes a distributed file system, known as HADOOP DISTRIBUTED FILE SYSTEM (HDFS™). HDFS™ links together the file systems on local nodes to form a unified file system that spans the entire HADOOP™ cluster. HADOOP™ also includes HADOOP™ YARN that provides a framework for job scheduling and cluster resource management that is utilized by a programming framework known as MapReduce. HADOOP™ is also supplemented by other Apache projects including APACHE HIVE™ (hereinafter “HIVE™”) and APACHE HBASE™ (hereinafter “HBASE™”). HIVE™ is a data warehouse infrastructure that provides data summarization and ad hoc querying. HBASE™ is a scalable, distributed NoSQL (No Structured Query Language) database or data store that supports structured data storage for large tables.

MapReduce processes data in parallel by mapping or dividing a work into smaller sub-problems and assigning them to worker nodes in a cluster. The worker nodes process the sub-problems and return the results, which are combined to “reduce” to an output that is passed on a solution. MapReduce is a batch processing framework, and is optimized for processing large amount of data in parallel by distributing the workload across different machines. MapReduce offers advantages including fault tolerance, but also suffers from severe disadvantages such as high latency.

The latency in MapReduce is a result of its batch oriented map/reduce model. In MapReduce, during an execution, the output of the “map” phase serves as the input for the “reduce” phase, such that the “reduce” phase cannot be completed before the “map” phase of execution is complete. Furthermore, all the intermediate data is stored on the disc before download to the reducer. Because of the above reasons, MapReduce adds latency which can cause a simple query started through MapReduce to take a long time to execute.

HIVE™ is a framework that lies on top of MapReduce. HIVE™ translates a language that looks like Structured Query Language (SQL) to MapReduce code, making data access in a HADOOP™ cluster much easier for users. HIVE™, however, still uses MapReduce as its execution engine, under the covers, and inherits all the disadvantages of MapReduce. Due to this, simple HIVE™ queries can take a long time to execute.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 depicts a diagram illustrating an example environment in which a low latency query engine may be deployed.

FIG. 2 depicts a block diagram illustrating example components of a unified platform supporting batch-oriented and real-time, ad hoc queries.

FIGS. 3A-3B depict block diagrams of example components of an installation manager and a low latency query engine installed on a data node in a Hadoop cluster to provide interactive, real-time Structured Query Language (SQL) queries directly on a unified storage layer.

FIG. 4 depicts an example method of processing an SQL query by a low latency query engine for Hadoop.

FIGS. 5A-5F depict example flows for query execution using a low latency query engine for Hadoop.

FIG. 6 depicts a block diagram illustrating execution of an example query plan by a low latency query engine for Hadoop.

FIG. 7 depicts a screenshot illustrating example execution times for a query performed on a data set using Hive and a low latency query engine.

FIG. 8 depicts a block diagram illustrating a low latency query engine for real-time, ad hoc queries in a business intelligence environment.

FIG. 9 depicts a diagrammatic representation of a machine in the example form of a computer system within which a set of instructions, for causing the machine to perform any one or more of the methodologies discussed herein, may be executed.

DETAILED DESCRIPTION

The following description and drawings are illustrative and are not to be construed as limiting. Numerous specific details are described to provide a thorough understanding of the disclosure. However, in certain instances, well-known or conventional details are not described in order to avoid obscuring the description. References to one or an embodiment in the present disclosure can be, but not necessarily are, references to the same embodiment; and, such references mean at least one of the embodiments.

Reference in this specification to “one embodiment” or “an embodiment” means that a particular feature, structure, or characteristic described in connection with the embodiment is included in at least one embodiment of the disclosure. The appearances of the phrase “in one embodiment” in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. Moreover, various features are described which may be exhibited by some embodiments and not by others. Similarly, various requirements are described which may be requirements for some embodiments but not other embodiments.

The terms used in this specification generally have their ordinary meanings in the art, within the context of the disclosure, and in the specific context where each term is used. Certain terms that are used to describe the disclosure are discussed below, or elsewhere in the specification, to provide additional guidance to the practitioner regarding the description of the disclosure. For convenience, certain terms may be highlighted, for example using italics and/or quotation marks. The use of highlighting has no influence on the scope and meaning of a term; the scope and meaning of a term is the same, in the same context, whether or not it is highlighted. It will be appreciated that same thing can be said in more than one way.

Consequently, alternative language and synonyms may be used for any one or more of the terms discussed herein, nor is any special significance to be placed upon whether or not a term is elaborated or discussed herein. Synonyms for certain terms are provided. A recital of one or more synonyms does not exclude the use of other synonyms. The use of examples anywhere in this specification including examples of any terms discussed herein is illustrative only, and is not intended to further limit the scope and meaning of the disclosure or of any exemplified term. Likewise, the disclosure is not limited to various embodiments given in this specification.

Without intent to further limit the scope of the disclosure, examples of instruments, apparatus, methods and their related results according to the embodiments of the present disclosure are given below. Note that titles or subtitles may be used in the examples for convenience of a reader, which in no way should limit the scope of the disclosure. Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this disclosure pertains. In the case of conflict, the present document, including definitions will control.

Embodiments of the present disclosure include a low latency (LL) query engine for HADOOP™. Embodiments of the present disclosure also include systems and methods for executing queries, in real time or near real time, on data stored in HADOOP™. Embodiments of the present disclosure further include systems and methods for executing ad hoc queries, on data of any format, stored in HADOOP™.

The low latency (LL) query engine for HADOOP™ as disclosed provides an alternate processing framework that offers fast, interactive query results and uses a familiar SQL query syntax. The low latency (LL) query engine does not use MapReduce to generate results, but instead queries the data directly via its daemons, which are spread across the HADOOP™ cluster.

In one embodiment, the low latency (LL) query engine provides a mechanism for fast querying of unstructured and/or structured big data. The low latency (LL) query engine can rapidly return information in response to queries. In many cases, results to queries, even on large amounts of data, can be returned in real-time or near real-time. Unlike MapReduce which starts jobs which then query the data, the low latency (LL) query engine performs queries directly on data stored in HDFS™ and/or in HBASE™ tables. The direct query capability provides users the ability to perform high speed queries on data as the data is being ingested in to the system.

In one embodiment, the low latency benefits of the low latency (LL) query engine allows users to perform queries in an interactive manner. With existing query engines such as MapReduce, even a simple query can take tens of minutes. As a result, a user has to wait that long to see a result, and start another query.

In another embodiment, the low latency (LL) query engine implements a schema-on-read model that decouples processing from data storage. Regardless of the format in which data is stored in the underlying storage layer of HDFS™ and HBASE™, the low latency (LL) query engine directly queries such data using relevant schema extracted at run time. By not being coupled to a rigid schema, the low latency (LL) query engine allows users to ask ad hoc exploratory questions that can lead to insights and other discovery.

Example Environment For Deploying a Low Latency (LL) Query Engine

FIG. 1 depicts a diagram illustrating an example environment 100 in which a low latency (LL) query engine may be deployed. Environment 100 depicts a client 104 such as Java Database Connectivity (JDBC) client, Open Database Connectivity (ODBC) client, and the like that provides API and other tools for connecting and/or accessing a HADOOP™ cluster. SQL applications 102 such as Hue, provide a user interface for HADOOP™ to run queries or jobs, browse the HDFS™, create workflows and the like. Environment 100 also includes a command line interfacE 116 for issuing queries to the low latency (LL) query engine daemons running on data nodes 120 a-c that comprise the HADOOP™ cluster. In one embodiment, the client 104, the web application 102 and the command line interface 116, each or together may be commonly referred to as a client.

Environment 100 depicts a plurality of data nodes 120 a-c. A low latency (LL) query engine daemon runs on each of the data nodes. A low latency (LL) query engine daemon is a long running process that coordinates and executes queries. Each instance of the low latency (LL) query engine daemon can receive, plan and coordinate queries received via the clients 102/104. For example, the low latency (LL) query engine can divide a query into fragments, which are distributed among remote nodes running an instance of the low latency (LL) query engine for execution in parallel. Some of the data nodes 120 a-c may run just HDFS™, while others may run HBASE™ region servers 122 a-c. The queries are executed directly on the HDFS™ (e.g., 120 a-c) and/or HBASE™ (e.g., 122 a-c).

Environment 100 depicts unified metadata and scheduler components such as HIVE™ metastore 106, YARN 108, HDFS™ name node 110 and/or state store 112. The HIVE™ metastore 106 includes information about the data available to the low latency (LL) query engine. Specifically, the HIVE™ metastore includes the table definition, i.e., mapping of the physical data into the logical tables that are exposed. The YARN 108 performs job scheduling and cluster resource management. The HDFS™ name node (NN) 110 includes the details of the distribution of the files across data nodes to optimize local reads. In one implementation, the name node 110 may even include information concerning disk volumes the files sit on, on an individual node.

The state store 112 is a global system repository which runs on a single node in the cluster. The state store 112 in one implementation can be used as a name service. All low latency (LL) query engine daemons, at start up, can register with the state store and get membership information. The membership information can be used to find out about all the low latency (LL) query engine daemons that are running on the cluster. The state store 112, in a further implementation, can be used to provide metadata for running queries. The state store 112 can cache metadata and distribute the metadata to the low latency (LL) query engine daemons at start up or another time. When the state store fails, the rest of the system may continue to operate based on last information received from the state store. In a further implementation, the state store can store and distribute other system information such as load information, diagnostics information, and the like that may be used to improve the functioning and/or performance of the HADOOP™ cluster.

FIG. 2 depicts a block diagram illustrating example components of a unified HADOOP™ platform 212 supporting batch-oriented and real-time, ad hoc queries. The unified HADOOP™ platform 212 supports distributed processing and distributed storage. The unified HADOOP™ platform 212 includes a user interface 214, storage 220 and meta data 222 components. The user interface 214 includes HIVE™ interfaces such as ODBC driver, JDBC driver, Hue Beeswax, and the like. The user interface 214 also includes SQL support. Via the user interface 214, queries can be issued, data can be read from or written to storage 220, etc. The storage 220 includes HDFS™ and/or HBASE™ storage. The HDFS™ may support various file formats, including but not limited to: text file, sequence file, RC file, Avro, and the like. Various compression codecs including snappy, gzip, deflate, bzip, and the like may also be supported. The metadata 222 may include, for example, information such as tables, their partitions, schema-on-read, columns, types, table/block locations, and the like. The metadata 222 may leverage existing HIVE™ metastore, which includes mapping of HBASE™ table, predicates on row key columns mapped into start/stop row, predicates on other columns mapped into single column value filters, and the like.

Existing HADOOP™ platform uses a batch oriented query engine (i.e., MapReduce) for batch processing 216 of HADOOP™ data. The batch processing capability of MapReduce is complemented by a real-time access component 218 in the unified HADOOP™ platform 212. The real-time access component 218 allows real-time, ad hoc SQL queries to be performed directly on the unified storage 220 via a distributed low latency (LL) query engine that is optimized for low-latency. The real-time access component 218 can thus support both queries and analytics on big data. Existing query engines (e.g., MapReduce), on the other hand, feature tight coupling of the storage, metadata and the query, which means that such query engines would need to read the data remotely from HADOOP™, and convert it into their storage format before they can do queries because of the tight coupling.

FIG. 3A depicts a block diagram of example components of an installation manager 302 for installing components of a low latency (LL) query engine in a HADOOP™ cluster to provide interactive, real-time SQL queries directly on a unified storage layer.

The manager 302 is an installation manager that can automatically install, configure, manage and monitor the low latency (LL) query engine. Alternately, the low latency (LL) query engine may be installed manually. The installation manger 302 installs three binaries including an low latency (LL) query engine daemon 304, a state store daemon 306 and a low latency (LL) query engine shell 308. As described above, the low latency (LL) query engine daemon 304 is a service or process that plans and executes queries against HDFS™ and/or HBASE™. The low latency (LL) query engine daemon is installed on each data node in the cluster. The state store daemon 306 is a name service that tracks the location and status of all the low latency (LL) query engine daemon instances in the cluster. The state store daemon 306 can also be a metadata store for providing metadata and/or other diagnostic information in some implementations. The low latency (LL) query engine shell 308 is a command line interface for issuing queries to a low latency (LL) query engine daemon, and is installed on a client.

FIG. 3B depicts a block diagram of example components of a low latency (LL) query engine daemon installed on each data node in a HADOOP™ cluster. A low latency (LL) query engine daemon 304 is installed at each data node 314, as depicted. The low latency (LL) query engine daemon 304 includes a query planner 316, a query coordinator 318 and a query execution engine 320 in one embodiment. The query planner 314 turns query requests from clients into collections of plan fragments, and provides the planned fragments to the query coordinator 318. The query planner 314 may constitute the front end of the low latency (LL) query engine, and may be written in Java, or another suitable language, to facilitate interaction with the rest of the HADOOP™ environment, such as the meta store/state store, APIs, and the like. The query planner 314 can use various operators such as Scan, HashJoin, HashAggregation, Union, TopN, Exchange, and the like to construct a query plan. Each operator can either materialize or generate data or combine data in some way. In one implementation, for example, the query planner can create a lefty plan or tree of one or more operators (e.g., manually or using an optimizer). The scan operator allows a plan to be broken up along scan lines or boundaries. Specialized scan nodes may be present for all the different storage managers. So, for example, there may be an HDFS™ scan node and an HBASE™ scan node, each of which can internally employ different process for different file formats. Some plans combine data for hash aggregation which can fill up a hash table and then output the aggregate results. A union operator can merge the output from different plan fragments. A TopN operator can be the equivalent of order by with the limit. The exchange operator can handle the data exchange between two plan fragments running on two different nodes.

The query coordinator 318 initiates execution of the planned fragments across all of the low latency (LL) query engine daemons that are involved in the query. The query coordinator 318 uses the membership information from the state store and/or location information for the data blocks from the Name Node to determine or identify the low latency (LL) query engine daemons on data nodes for executing query plan fragments. In one implementation, the query coordinator 318 can also apply any predicates from the query to narrow down to the set of files and blocks the plan fragments should be run against. The query coordinator 318 can also perform the final aggregation or merge of data from the low latency (LL) query engine daemons in remote nodes. In one implementation, the low latency (LL) query engine daemons may pre-aggregate some of the data, so that the aggregation is distributed across the nodes, thereby speeding up the query.

The query execution engine 320 executes the planned query fragments locally on the HDFS™ and HBASE™. For example, the query execution engine 320 initiates the scan and/or any other query operators. The query execution engine 320 is written in C++, but may also be written in any other suitable language such as Java. The query execution engine is an execution engine that is separate from MapReduce. While the query execution engine uses the infrastructure that provides the data (e.g., HDFS™ and HBase™), the query execution engine does not utilize any of the infrastructures that run map reductions, such as job trackers or task trackers.

In one embodiment, the query execution engine 320 can include a component 322, a low level virtual machine (LLVM), an optimizer, or other compiler infrastructure, for run-time code generation in order to transform interpretive code into a format that can be efficiently executed by the central processing unit (CPU). Typical relational database systems for instance, have interpretive code for evaluating expressions to extract data from indices etc. The query execution engine avoids this problem by using low level virtual machines (LLVMs) to more tightly couple code with hardware. For example, an expression where A equals B over A+B equals C in a query can be evaluated by making three function calls. Instead of making the three function calls, LLVM uses the operations that the CPU provides in order to evaluate the expression and achieve speed gains.

In a further embodiment, the low latency (LL) query engine can also use special CPU instructions, in order to, for example, perform text processing and/or other resource intensive processes. By way of another example, hash value computations may be performed using a special Cyclic Redundancy Check (CRC32) instruction to achieve speed gains.

Example Query Processing

FIG. 4 depicts an example method of processing an SQL query by a low latency (LL) query engine for HADOOP™. As described above, an instance of the low latency (LL) query engine runs on each node that has data (e.g., HDFS™ and HBASE™) in the HADOOP™ cluster. A user submits a query via a client (e.g., ODBC client/Hue/command line tool) to any of the low latency (LL) query engine demons. Via the client (e.g., the ODBC client), the user can target any of the low latency (LL) query engine daemons, by directly connecting to a particular low latency (LL) query engine daemon on a data node. Alternately, a round robin strategy may be used to spread the load across all the remote daemons in the cluster.

In one implementation, at block 402, a user facing side of a low latency (LL) query engine daemon (i.e., a query planner) receives or accepts a query request from the user. The query planner turns the request into a collection of plan fragments at block 406, and hands off the query plan fragments to a query coordinator in the same node. The query coordinator serves as a single instance that coordinates the entire plan of execution across all other low latency (LL) query engine daemons or remote daemons involved in the query. In one implementation, to coordinate the entire plan of execution, the query coordinator receives or obtains membership information from the state store and location information from the name node (for HDFS™ query) at block 408. Using the membership information and the block location information, the query coordinator determines which daemons or nodes in the cluster should receive the query plan fragments for execution. At block 410, the query coordinator distributes the query plan fragments to the nodes having relevant data to initiate execution of the plan fragments against the data local to each node.

During execution, all the nodes can talk to each other in a streaming fashion. In one implementation, if the query does not involve aggregation or blocking operators as determined at decision block 412, results streamed from the query executors (i.e., query execution engines of nodes receiving the query plan fragments) are received by the query coordinator at block 414. The results are then streamed back to the user via the client at block 416.

Alternately, if a blocking or aggregator operator is present in the query, as determined at decision block 412, intermediate results are streamed between the query executors and pre-aggregated at one or more the nodes at block 418. At block 420, the query coordinator performs an aggregation or merge of the pre-aggregated results to determine the final result, which is then sent to the user via the client at block 416.

FIGS. 5A-5F depict example flows for query execution using a low latency (LL) query engine for HADOOP™.

Referring to FIG. 5A, the HADOOP™ environment 500 for operating the low latency (LL) query engine includes a common HIVE™ SQL and interface including an SQL application 502 and a client 504 such as the ODBC client, JDBC client, and the like. The environment also includes unified meta data and scheduler entities such as the HIVE™ meta store 506, YARN 508, HDFS™ name node 510 and/or state store 512. As depicted in this example, the HADOOP™ environment includes a cluster of three HDFS™ data nodes 520 a-c, each of which has an instance of the low latency (LL) query engine daemon 526 a-c respectively, running on top. The client connects to only one instance of the low latency (LL) query engine daemon (e.g., 526 b). The low latency (LL) query engine daemon connects to or communicates with one or more of the unified meta data and scheduler entities. Furthermore, as depicted, the low latency (LL) query engine daemons connect to each other for distributed and fully massively parallel processing (MPP). It should be noted that low latency (LL) query engine daemons 526 a-c on data nodes 520 a-c and the state store 512 are the components of the low latency (LL) query engine that provides real-time, ad hoc query capability in HADOOP™. The low latency (LL) query engine leverages existing common HIVE™ SQL and Interface 502 and 504, HIVE™ metastore 506, YARN 508, HDFS™ name node 510 and the unified storage layer comprising the HDFS™ data node 520 a-c and HBASE™ region servers 522 a-c.

Referring to FIG. 5B, a user using the SQL application 502 submits an SQL query request 524 via a client 504. The SQL query request can go any of the nodes 526 a-c. In one implementation, the node to which the SQL query request should be sent can be specified via the client/application. Alternately, a node can be selected based on a round robin or other scheduling method for load balancing. An instance of the low latency (LL) query engine daemon 526 b on the HDFS™ data node 520 b is depicted as the recipient of the SQL query request 524. The SQL query request 524 interacts with the query planner 514 b of the low latency (LL) query engine daemon 526 b.

Referring to FIG. 5C, the query planner 514 b and/or the query coordinator 516 b that received the query request 524, communicates with one or more of the unified meta data and scheduler entities to get information for creating a plan for the query request and/or coordinating execution of the query request. For example, the query planner and/or coordinator may determine which data nodes are available, and the location of data blocks relevant to the query. In HDFS™, replicas of data blocks are stored in various data nodes. The query planner and/or coordinator can communicate with the name node 510 to determine where each of the replicas for each data block is stored and can select one of the replicas to run the query. A round robin or another method may be used in selecting a replica from the group of replicas of data blocks. The query planner 514 b can parse and analyze the query request to determine tasks that can be distributed across the low latency (LL) query engine daemons in the cluster.

Referring to FIG. 5D, the query coordinator 516 b hands off the tasks or plan fragments from the query planner 514 b to the query execution engines 518 a-c of each of the nodes that hold data relevant to the query request. All three query execution engines run in parallel and distributed fashion. Referring to FIG. 5E, the query execution engines 518 a-c execute the plan fragments locally on the nodes that hold the relevant data. For example, the query execution engine 518 c performs a local direct read of HDFS™ data stored in HDFS™ data node 520 c. Similarly, the query execution engines 518 a and 518 b perform local direct reads of data stored in HDFS™ data node 520 a and HBASE™ 522 b respectively. The query execution engines 518 a-c may also initiate other query operators specified in the plan fragments.

Referring to FIG. 5F, results from the query executions engines 518 a-c are passed to the query coordinator 516 b via in memory transfers. If the query involves block operations (e.g., TopN, aggregation, etc.), intermediate results are streamed between the RT query engine demon nodes for pre-aggregation, and the final result is aggregated at the query coordinator 516 b. Keeping query results or intermediate results in memory provides performance improvement as the transfers are not bound by the speed of the disks. The final results 528 to the query request 524 is then returned by the query coordinator 516 b to the user via the client 504 and the SQL application 502.

FIG. 6 depicts a block diagram illustrating execution of an example query plan by a low latency (LL) query engine for HADOOP™.

The query plan 602 corresponds to an example query provided below.

SELECT state, SUM(revenue)

FROM HdfsTbl h JOIN HbaseTbl b ON ( . . . )

GROUP BY 1 ORDER BY 2 desc LIMIT 10

The query plan 602 comprises an HDFS™ scan and an HBASE™ scan, joining of the data from the two scans and computing an aggregation with a grouping (TopN) operation. The query plan 602 is broken along scan lines to form separate plan fragments. For example, one plan fragment may include an HBASE™ data scan and another plan fragment may include an HDFS™ data scan. The HBASE™ scan is run locally at region servers that hold the HBASE™ data relevant to the query as depicted at block 608. The HDFS™ scan is also run locally on data nodes holding the relevant HDFS™ data as depicted in block 606.

In one implementation, it may be more optimal to execute the join operation close to the scanners that produce the actual data. As depicted in block 606, the data nodes have exchange nodes or operators that receive data broadcast from the HBASE™ scans. At the data nodes, the hash join operation builds an in memory hash table and performs the joining operation, following by a pre-aggregation operation. The output of the pre-aggregation operation is then sent to the final plan fragment 604. The final plan fragment has only once instance and runs on the query coordinator handling the query. At the coordinator, an exchange node receives the data from the pre-aggregation and performs an aggregation operation in another hash table. The output of the aggregation operation is then run though a TopN operation that produces the final result that is provided to the client. As depicted, both HDFS™ and HBASE™ scans can occur in parallel. Similarly, the join and aggregation operations can also occur in parallel at data nodes holding the relevant data. The parallel execution, along with in-memory transfers of intermediate data, can result in low latency response to queries.

Consider that the RT query engine illustrated in FIGS. 5E-F is processing the query of FIG. 6. Referring to FIG. 5E, the query execution engines 518 a and 518 c scan HDFS™ data on the HDFS™ data node 520 a and 520 c respectively. The query engine 518 b scans HBASE™ data 522 b. Referring to FIG. 5F, the query execution engine 518 b performing the HBASE™ scan, broadcasts the data from the scan to the two execution engines 518 a and c performing the HDFS™ scans as depicted. Each of the query execution engines 518 a and 518 c in turn performs a join operation, and sends pre-aggregation results to the initiating query coordinator 516 b. The initiating query coordinator then aggregates the results and performs a TopN operation to obtain a final result that is then provided to the client 504 as SQL result 528. In implementations where there is no need for any aggregation, data streamed to the query coordinator from the query execution engines may be streamed to the client in a very fast and efficient manner.

FIG. 7 depicts a screenshot illustrating example execution times for a query performed on a data set using HIVE™ and a low latency (LL) query engine. The query is performed on a virtual machine with example data set to determine the number of entries in a table using HIVE™/MapReduce and the low latency (LL) query engine. Since a query that is executed in HIVE™ must run one or more MapReduce jobs to retrieve the results, it takes HIVE™ almost 40 seconds to execute a single COUNT query. Much of the 40 seconds is actually used to start up and tear down the MapReduce job. When the same COUNT query is executed on the same data set using the low latency (LL) query engine, the execution time is significantly reduced to about 0.5 seconds as depicted. The significant reduction in the query execution time illustrates the advantage of the low latency (LL) query engine in providing real-time interaction with the HADOOP™ cluster to perform analytical, transactional, and any other queries without having to wait a long time in between queries.

Data Management

In one embodiment, the low latency (LL) query engine provides the advantage of low latency which allows users to query large volumes of data and obtain answers at much faster speed than possible using the existing batch processing framework of HIVE™ and MapReduce. In a further embodiment, the RT query engine provides flexibility in defining schemas that can be used to search for hidden insights in large volumes of data.

In relational database management systems (RDBMS), a schema is defined first (i.e., schema-on-write model). The format of the input data is converted to the proprietary format of the database prior to storing the input data. A schema-on-write model works well for answering known questions. If a previously unknown question needs to be answered, new data may need to be captured. However, with a rigid schema, the database system cannot start accepting new data that does not match the schema. To fit in the new data, the schema must be modified or amended. In order to modify or upgrade the schema to capture new data, data architects typically need to change all the systems connected to the database system to, for example, correctly parse and load the new data, read or recognize the new data, and the like. This process of upgrading the schema and ensuring that all the systems that are tightly coupled with the database system work together, can take a long time. Until then, the new data cannot be captured to answer the question.

The low latency (LL) query engine decouples the processing of the data from the storing of data. For example, the underlying storage system in Hadoop can accept files in their original native format (e.g., tab-delimited text files, CSV, XML, JSON, images, etc.). The low latency (LL) query engine uses a schema-on-read model to translate the data stored in any format into an economical in memory format (e.g., Tuple format) on the fly. For example, when the low latency (LL) query engine interacts with text data, the low latency (LL) query engine can read the text data once, perform a transformation, and the data from the transformation can be handled in the economical in memory format till all the processing is complete.

The low latency (LL) query engine leverages an existing HADOOP™ components such as the HIVE™ metastore and the underlying unified storage (HDFS™ and HBASE™). The data that the low latency (LL) query engine queries against is simultaneously available to MapReduce. For example, a query is being executed, the low latency (LL) query engine parses the file (any format) and extracts the relevant schema from the meta store at run time. In other database systems, this is not possible as the format of the data and the definition of how a user interacts with the data (i.e., schema in the meta store) are tightly coupled. Thus a database file stored in Oracle database can be read by Oracle and no other framework.

FIG. 8 depicts a block diagram illustrating a low latency (LL) query engine for real-time, ad hoc queries in a business intelligence environment. As depicted, HADOOP™ 804 stores original data 806 in their native format. Unlike tradition relational databases where data fitting into a rigid schema is collected, the original data 810 does not adhere to any rigid schema and is in fact decoupled from the processing aspect. The low latency (LL) query engine 806 running on a data node in HADOOP™ can accept a query 808 from an application such as a business intelligence (BI) tool 816 via a client (e.g., ODBC/JDBC driver).

The query 808 can be made using a flexible schema-on-read model that can be defined, adapted and/or re-adapted to extract new value from the data 810 that would not be possible with rigid schemas. The low latency (LL) query engine 806 can read and parse relevant data once, perform a transformation, and store the transformed data 812 is an optimized in memory format to provide a fast response to the query 808.

FIG. 9 shows a diagrammatic representation of a machine in the example form of a computer system within which a set of instructions, for causing the machine to perform any one or more of the methodologies discussed herein, may be executed.

In the example of FIG. 9, the computer system 900 includes a processor, memory, non-volatile memory, and an interface device. Various common components (e.g., cache memory) are omitted for illustrative simplicity. The computer system 900 is intended to illustrate a hardware device on which any of the components depicted in the example of FIG. 1 (and any other components described in this specification) can be implemented. The computer system 900 can be of any applicable known or convenient type. The components of the computer system 900 can be coupled together via a bus or through some other known or convenient device.

The processor may be, for example, a conventional microprocessor such as an Intel Pentium microprocessor or MOTOROLA POWERPC™ microprocessor. One of skill in the relevant art will recognize that the terms “machine-readable (storage) medium” or “computer-readable (storage) medium” include any type of device that is accessible by the processor.

The memory is coupled to the processor by, for example, a bus. The memory can include, by way of example but not limitation, random access memory (RAM), such as dynamic RAM (DRAM) and static RAM (SRAM). The memory can be local, remote, or distributed.

The bus also couples the processor to the non-volatile memory and drive unit. The non-volatile memory is often a magnetic floppy or hard disk, a magnetic-optical disk, an optical disk, a read-only memory (ROM), such as a CD-ROM, EPROM, or EEPROM, a magnetic or optical card, or another form of storage for large amounts of data. Some of this data is often written, by a direct memory access process, into memory during execution of software in the computer 800. The non-volatile storage can be local, remote, or distributed. The non-volatile memory is optional because systems can be created with all applicable data available in memory. A typical computer system will usually include at least a processor, memory, and a device (e.g., a bus) coupling the memory to the processor.

Software is typically stored in the non-volatile memory and/or the drive unit. Indeed, for large programs, it may not even be possible to store the entire program in the memory. Nevertheless, it should be understood that for software to run, if necessary, it is moved to a computer readable location appropriate for processing, and for illustrative purposes, that location is referred to as the memory in this paper. Even when software is moved to the memory for execution, the processor will typically make use of hardware registers to store values associated with the software, and local cache that, ideally, serves to speed up execution. As used herein, a software program is assumed to be stored at any known or convenient location (from non-volatile storage to hardware registers) when the software program is referred to as “implemented in a computer-readable medium.” A processor is considered to be “configured to execute a program” when at least one value associated with the program is stored in a register readable by the processor.

The bus also couples the processor to the network interface device. The interface can include one or more of a modem or network interface. It will be appreciated that a modem or network interface can be considered to be part of the computer system. The interface can include an analog modem, isdn modem, cable modem, token ring interface, satellite transmission interface (e.g. “direct PC”), or other interfaces for coupling a computer system to other computer systems. The interface can include one or more input and/or output devices. The I/O devices can include, by way of example but not limitation, a keyboard, a mouse or other pointing device, disk drives, printers, a scanner, and other input and/or output devices, including a display device. The display device can include, by way of example but not limitation, a cathode ray tube (CRT), liquid crystal display (LCD), or some other applicable known or convenient display device. For simplicity, it is assumed that controllers of any devices not depicted in the example of FIG. 8 reside in the interface.

In operation, the computer system 800 can be controlled by operating system software that includes a file management system, such as a disk operating system. One example of operating system software with associated file management system software is the family of operating systems known as WINDOWS™ from Microsoft Corporation of Redmond, Wash., and their associated file management systems. Another example of operating system software with its associated file management system software is the LINUX™ operating system and its associated file management system. The file management system is typically stored in the non-volatile memory and/or drive unit and causes the processor to execute the various acts required by the operating system to input and output data and to store data in the memory, including storing files on the non-volatile memory and/or drive unit.

Some portions of the detailed description may be presented in terms of algorithms and symbolic representations of operations on data bits within a computer memory. These algorithmic descriptions and representations are the means used by those skilled in the data processing arts to most effectively convey the substance of their work to others skilled in the art. An algorithm is here, and generally, conceived to be a self-consistent sequence of operations leading to a desired result. The operations are those requiring physical manipulations of physical quantities. Usually, though not necessarily, these quantities take the form of electrical or magnetic signals capable of being stored, transferred, combined, compared, and otherwise manipulated. It has proven convenient at times, principally for reasons of common usage, to refer to these signals as bits, values, elements, symbols, characters, terms, numbers, or the like.

It should be borne in mind, however, that all of these and similar terms are to be associated with the appropriate physical quantities and are merely convenient labels applied to these quantities. Unless specifically stated otherwise as apparent from the following discussion, it is appreciated that throughout the description, discussions utilizing terms such as “processing” or “computing” or “calculating” or “determining” or “displaying” or the like, refer to the action and processes of a computer system, or similar electronic computing device, that manipulates and transforms data represented as physical (electronic) quantities within the computer system's registers and memories into other data similarly represented as physical quantities within the computer system memories or registers or other such information storage, transmission or display devices.

The algorithms and displays presented herein are not inherently related to any particular computer or other apparatus. Various general purpose systems may be used with programs in accordance with the teachings herein, or it may prove convenient to construct more specialized apparatus to perform the methods of some embodiments. The required structure for a variety of these systems will appear from the description below. In addition, the techniques are not described with reference to any particular programming language, and various embodiments may thus be implemented using a variety of programming languages.

In alternative embodiments, the machine operates as a standalone device or may be connected (e.g., networked) to other machines. In a networked deployment, the machine may operate in the capacity of a server or a client machine in a client-server network environment, or as a peer machine in a peer-to-peer (or distributed) network environment.

The machine may be a server computer, a client computer, a personal computer (PC), a tablet PC, a laptop computer, a set-top box (STB), a personal digital assistant (PDA), a cellular telephone, an iPhone, a Blackberry, a processor, a telephone, a web appliance, a network router, switch or bridge, or any machine capable of executing a set of instructions (sequential or otherwise) that specify actions to be taken by that machine.

While the machine-readable medium or machine-readable storage medium is shown in an exemplary embodiment to be a single medium, the term “machine-readable medium” and “machine-readable storage medium” should be taken to include a single medium or multiple media (e.g., a centralized or distributed database, and/or associated caches and servers) that store the one or more sets of instructions. The term “machine-readable medium” and “machine-readable storage medium” shall also be taken to include any medium that is capable of storing, encoding or carrying a set of instructions for execution by the machine and that cause the machine to perform any one or more of the methodologies of the presently disclosed technique and innovation.

In general, the routines executed to implement the embodiments of the disclosure, may be implemented as part of an operating system or a specific application, component, program, object, module or sequence of instructions referred to as “computer programs.” The computer programs typically comprise one or more instructions set at various times in various memory and storage devices in a computer, and that, when read and executed by one or more processing units or processors in a computer, cause the computer to perform operations to execute elements involving the various aspects of the disclosure.

Moreover, while embodiments have been described in the context of fully functioning computers and computer systems, those skilled in the art will appreciate that the various embodiments are capable of being distributed as a program product in a variety of forms, and that the disclosure applies equally regardless of the particular type of machine or computer-readable media used to actually effect the distribution.

Further examples of machine-readable storage media, machine-readable media, or computer-readable (storage) media include but are not limited to recordable type media such as volatile and non-volatile memory devices, floppy and other removable disks, hard disk drives, optical disks (e.g., Compact Disk Read-Only Memory (CD ROMS), Digital Versatile Disks, (DVDs), etc.), among others, and transmission type media such as digital and analog communication links.

Unless the context clearly requires otherwise, throughout the description and the claims, the words “comprise,” “comprising,” and the like are to be construed in an inclusive sense, as opposed to an exclusive or exhaustive sense; that is to say, in the sense of “including, but not limited to.” As used herein, the terms “connected,” “coupled,” or any variant thereof, means any connection or coupling, either direct or indirect, between two or more elements; the coupling of connection between the elements can be physical, logical, or a combination thereof. Additionally, the words “herein,” “above,” “below,” and words of similar import, when used in this application, shall refer to this application as a whole and not to any particular portions of this application. Where the context permits, words in the above Detailed Description using the singular or plural number may also include the plural or singular number respectively. The word “or,” in reference to a list of two or more items, covers all of the following interpretations of the word: any of the items in the list, all of the items in the list, and any combination of the items in the list.

The above detailed description of embodiments of the disclosure is not intended to be exhaustive or to limit the teachings to the precise form disclosed above. While specific embodiments of, and examples for, the disclosure are described above for illustrative purposes, various equivalent modifications are possible within the scope of the disclosure, as those skilled in the relevant art will recognize. For example, while processes or blocks are presented in a given order, alternative embodiments may perform routines having steps, or employ systems having blocks, in a different order, and some processes or blocks may be deleted, moved, added, subdivided, combined, and/or modified to provide alternative or subcombinations. Each of these processes or blocks may be implemented in a variety of different ways. Also, while processes or blocks are at times shown as being performed in series, these processes or blocks may instead be performed in parallel, or may be performed at different times. Further any specific numbers noted herein are only examples: alternative implementations may employ differing values or ranges.

The teachings of the disclosure provided herein can be applied to other systems, not necessarily the system described above. The elements and acts of the various embodiments described above can be combined to provide further embodiments.

Any patents and applications and other references noted above, including any that may be listed in accompanying filing papers, are incorporated herein by reference. Aspects of the disclosure can be modified, if necessary, to employ the systems, functions, and concepts of the various references described above to provide yet further embodiments of the disclosure.

These and other changes can be made to the disclosure in light of the above Detailed Description. While the above description describes certain embodiments of the disclosure, and describes the best mode contemplated, no matter how detailed the above appears in text, the teachings can be practiced in many ways. Details of the system may vary considerably in its implementation details, while still being encompassed by the subject matter disclosed herein. As noted above, particular terminology used when describing certain features or aspects of the disclosure should not be taken to imply that the terminology is being redefined herein to be restricted to any specific characteristics, features, or aspects of the disclosure with which that terminology is associated. In general, the terms used in the following claims should not be construed to limit the disclosure to the specific embodiments disclosed in the specification, unless the above Detailed Description section explicitly defines such terms. Accordingly, the actual scope of the disclosure encompasses not only the disclosed embodiments, but also all equivalent ways of practicing or implementing the disclosure under the claims.

While certain aspects of the disclosure are presented below in certain claim forms, the inventors contemplate the various aspects of the disclosure in any number of claim forms. For example, while only one aspect of the disclosure is recited as a means-plus-function claim under 35 U.S.C. § 112, ¶6, other aspects may likewise be embodied as a means-plus-function claim, or in other forms, such as being embodied in a computer-readable medium. (Any claims intended to be treated under 35 U.S.C. § 112, ¶6 will begin with the words “means for”.) Accordingly, the applicant reserves the right to add additional claims after filing the application to pursue such additional claim forms for other aspects of the disclosure. 

What is claimed is:
 1. A system for performing queries in a HADOOP™ distributed computing cluster having a plurality of data nodes storing data, the data nodes having processing circuitry, the system comprising: a plurality of data nodes forming a peer network, a respective data node functioning as a peer in the peer network and being capable of interacting with components of the HADOOP™ cluster, the respective data node operating an instance of a low latency query engine that queries data directly from the respective data node, the query engine is configured to: receive a query from a client; obtain, from the components of the HADOOP™ cluster, location information regarding where one or more data blocks relevant to the received query are distributed among nodes in the cluster; create query fragments based on the obtained location information; construct a query plan based on the obtained location information; distribute the query fragments among the nodes in the cluster according to the query plan; receive intermediate results from the nodes in the cluster that receive the query fragments; and aggregate the intermediate results for the client.
 2. The system of claim 1, wherein the instance of the query engine is further configured to stream the intermediate results to the client as the intermediate results arrive.
 3. The system of claim 1, wherein the instance of the query engine is further configured to execute a query fragment against local data where the instance of the query engine is located.
 4. The system of claim 3, wherein the query fragment against the local data is executed as the query fragment is received, without entering a queue for batched processing.
 5. The system of claim 3, wherein the instance of the query engine is further configured to transmit a result of executing the query fragment against the local data to another data node.
 6. The system of claim 3, wherein the instance of the query engine is further configured to utilize, for executing the query fragment, a different process based on a format in which the local data is stored.
 7. The system of claim 1, wherein the instance of the query engine is further configured to transmit the aggregated intermediate results to another data node for further aggregation.
 8. The system of claim 7, wherein the instance of the query engine is further configured to perform a join operation on the intermediate results before transmitting the aggregated intermediate results to the another data node.
 9. The system of claim 1, wherein the query plan includes utilizing one or more of: a scan operator, a hash join operator, a hash aggregation operator, a union operator, a TopN operator, or an exchange operator.
 10. The system of claim 1, wherein the respective data node is coupled to specialized scan nodes for executing query fragments that are specific to different storage managers.
 11. The system of claim 1, wherein the query plan breaks the query into query fragments along scan lines.
 12. The system of claim 1, wherein the instance of the query engine is further configured to utilize instruction sets unique to a local processing circuitry to reduce a number of function calls necessary to execute the query fragments.
 13. The system of claim 1, wherein the data is stored in an unstructured format.
 14. The system of claim 1, wherein the instance of the query engine is further configured to: extract a schema for data relevant to the query at query execution time; and convert local data relevant to the query from an unstructured format into a structured format, based on the schema, for a query fragment to be executed against the local data.
 15. The system of claim 14, wherein the structured format of the local data is held by the instance of the query engine as in-memory tuples.
 16. The system of claim 1, wherein the instance of the query engine store results associated with the query as in-memory tuples.
 17. The system of claim 1, wherein the query plan is further constructed based on a workload information of the peer network.
 18. The system of claim 1, wherein a query fragment is distributed to a data node among a plurality of data nodes that maintain replicas of a same data block.
 19. The system of claim 1, wherein the components of the HADOOP™ cluster maintain membership information regarding all query engine instances that are operated by the data nodes in the cluster.
 20. A method for operating a system that performs queries in a HADOOP™ distributed computing cluster having a plurality of data nodes storing data, the plurality of data nodes forming a peer network, a respective data node functioning as a peer in the peer network and being capable of interacting with components of the HADOOP™ cluster, the respective data node operating an instance of a low latency query engine that queries data directly from the respective data node, the query engine is configured to perform the method operations comprising: receiving a query from a client; obtaining, from the components of the HADOOP™ cluster, location information regarding where one or more data blocks relevant to the received query are distributed among nodes in the cluster; creating query fragments based on the obtained location information; constructing a query plan based on the obtained location information; distributing the query fragments among the nodes in the cluster according to the query plan; receiving intermediate results from the nodes in the cluster that receive the query fragments; and aggregating the intermediate results for the client. 